import request from '@/utils/request'

const api_name = '/cms/channel'

export default {
  // 创建分栏
  createChannel(channel) {
    return request({
      url: `${api_name}`,
      method: 'post',
      data: channel
    })
  },
  // 修改分栏信息
  updateChannel(channel) {
    return request({
      url: `${api_name}`,
      method: 'put',
      data: channel
    })
  },
  // 根据ID获取分栏
  getChannel(channelID) {
    return request({
      url: `${api_name}/channelID`,
      method: 'get'
    })
  },
  // 查看当前用户的所有分栏（不用分页）
  getAllChannels() {
    return request({
      url: `${api_name}/list`,
      method: 'get'
    })
  },
  // 删除分栏
  deleteChannel(channelID) {
    return request({
      url: `${api_name}/channelID`,
      method: 'delete'
    })
  }
}
